import React, { Component } from 'react'
import PropTypes from 'prop-types'
import './index.css'
import Item from '../Item'

export default class index extends Component {

  static propTypes = {
    todos:PropTypes.array.isRequired,
    updateToDo:PropTypes.func.isRequired,
    delteItem:PropTypes.func.isRequired
  }

  render() {
    const {todos,updateToDo,delteItem} = this.props
    return (
      <div className="listContainer">
        {
          todos.map(todo=>{
            return <Item updateToDo={updateToDo} todo={todo} key={todo.id} delteItem={delteItem}></Item>
          })
        }
      </div>
    )
  }
}
